package com.category.spi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("category")
public class Category {
    @TableId(type = IdType.AUTO)
    private Long id;

    //分类名称
    private String name;

    //可读唯一标识
    private String slug;

    //父类id
    @TableField("parent_id")
    private Long parentId;

    //层级
    private Integer level;

    //分类路径
    private String path;

    //排序
    @TableField("sort_order")
    private Integer sortOrder;

    /*状态*/
    private Integer status;

    /*是否是叶子节点*/
    @TableField("is_leaf")
    private Integer isLeaf;

    /** 创建时间 */
    @TableField("created_at")
    private LocalDateTime createdAt;

    /** 更新时间 */
    @TableField("updated_at")
    private LocalDateTime updatedAt;

    /** 软删除时间（非空表示已删除） */
    @TableField("deleted_at")
    private LocalDateTime deletedAt;

    private List<Category> children;


}
